/*
* Author: honrun
*/
#ifndef DEVICESUART_H_
#define DEVICESUART_H_


#define USART0_DMA_READ_LENGTH  (512)
#define USART0_DMA_SEND_LENGTH  (512)
#define USART1_DMA_READ_LENGTH  (512)
#define USART1_DMA_SEND_LENGTH  (512)
#define USART2_DMA_READ_LENGTH  (512)
#define USART2_DMA_SEND_LENGTH  (512)






extern uint8_t g_USART0ReadDMABuff[USART0_DMA_READ_LENGTH + 4];
extern uint8_t g_USART1ReadDMABuff[USART1_DMA_READ_LENGTH + 4];
extern uint8_t g_USART2ReadDMABuff[USART2_DMA_READ_LENGTH + 4];

/* 上一次DMA传输的长度序号值 */
extern volatile uint32_t g_uiUart0DMAReadCntOld;
extern volatile uint32_t g_uiUart1DMAReadCntOld;
extern volatile uint32_t g_uiUart2DMAReadCntOld;



void vUart0Init(void);
void vUart1Init(void);
void vUart2Init(void);


void vUart0DMAInit(void);
void vUart1DMAInit(void);
void vUart2DMAInit(void);


void vUartSendDatas(uint32_t uiUsartPeriph, uint8_t *pucDatas, int32_t iLength);
void vUartSendStrings(uint32_t uiUsartPeriph, char *pcStrings);

void vUartDMASendDatas(uint32_t uiUsartPeriph, uint8_t *pucDatas, int32_t iLength);
void vUartDMASendStrings(uint32_t uiUsartPeriph, char *pcStrings);


#endif /* DEVICESUART_H_ */
